<?php
/*
 * Created on 04.01.2006
 *
 */

m2import('phpinchains/Filter.php');

class FrameFilter extends phpinchains_Filter
{

    var $params;

    function init (& $config)
    {
        $this->params = $config;
    }

    function doFilter (& $env, & $chain)
    {
        print "<html><head><title>XICS Hilfe</title></head><frameset";
        $tiles = count(split(",", $this->params['rows']));
        print ($this->params['rows'])?' rows="'.$this->params['rows'].'"':' cols="'.$this->params['cols'].'"';
        print ($this->params['border'])?' border="'.$this->params['border'].'"':' border="0"';
        print '>'."\n";
        for ($i=1; $i<=$tiles; $i++)
            print "<frame ".str_replace("'", '"', $this->params['frame'.$i])."/>\n";
        print "</frameset></html>\n";
        $chain->doFilter($env);
    }

}

?>
